//
//  UIView+LH.h
//  LHChanel
//
//  Created by zhouLiHuan on 2017/2/9.
//  Copyright © 2017年 zhouLiHuan. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (LH)

/**
 带背景颜色的初始化
 */

+ (instancetype)viewWithFrame:(CGRect)frame andBackGroundColor:(UIColor *)backColor;

/**
 在顶部或者底部添加横线间隔的初始化
 */
+ (instancetype)viewWithFrame:(CGRect) frame andBackGorundColor:(UIColor *)backColor haveTopLine:(BOOL)isTopLine haveBottomLine:(BOOL)isBottomLine;

/**
 带边框的初始化
 */
+(instancetype)viewWithFrame:(CGRect)frame andBackGroundColor:(UIColor *)backColor borderWith:(CGFloat)borderWidth borderColor:(UIColor *)borderColor cornerRadius:(CGFloat)cornerRadius;
/**
 给view添加圆角和边框
 */
- (void)addCornerRadius:(CGFloat)cornerRadius andBorderColor:(UIColor *)borderColor;


#pragma mark - view的常用属性
@property (nonatomic,assign)CGFloat left;
@property (nonatomic,assign)CGFloat top;
@property (nonatomic,assign)CGFloat right;
@property (nonatomic,assign)CGFloat bottom;
@property (nonatomic,assign)CGFloat width;
@property (nonatomic,assign)CGFloat height;
@property (nonatomic,assign)CGFloat centerX;
@property (nonatomic,assign)CGFloat centerY;

//在屏幕的X
@property (nonatomic,readonly)CGFloat ttScreenX;
// 在屏幕的Y
@property (nonatomic,readonly)CGFloat ttScreenY;

//考虑了滚动视图的在屏幕中的X
@property (nonatomic,readonly)CGFloat screenViewX;
//考虑了滚动视图的在屏幕中的Y
@property (nonatomic,readonly)CGFloat screenViewY;

//在屏幕中的frame
@property (nonatomic,readonly)CGRect screenFrame;

@property (nonatomic,assign)CGPoint origin;
@property (nonatomic,assign)CGSize size;

//在竖屏下返回宽度 横屏下返回高度
@property (nonatomic,readonly)CGFloat orientationWidth;

//在竖屏下返回高度,横屏下返回宽度
@property (nonatomic,readonly)CGFloat orientationHeight;

/**
  子view(包括这个view)是否属于某个类
 */
- (UIView *)descendantOrSelfWithClass:(Class)desClass;

/**
 父控件(包括自己)是否属于某个类
 */
- (UIView *)ancestorOrSelfWithClass:(Class)anceCalss;

/**
 移除所有子控件
 */
- (void)removeAllSubviews;

/**
 相对于别的视图在屏幕上的偏移位置
 */

- (CGPoint)offsetFormView:(UIView *)otherView;


- (UIViewController *)viewController;

- (UIView *)findFirstResponderBeneathView:(UIView *)view;

- (UIImage *)getScreenShotImage;

@end



/**

- (UIImage *) getScreenshotImage;
 */
